package com.office.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.office.system.mapper.SysUsageMapper;
import com.office.system.domain.SysUsage;
import com.office.system.service.ISysUsageService;

/**
 * 领用管理Service业务层处理
 *
 * @author xyq
 * @date 2024-07-05
 */
@Service
public class SysUsageServiceImpl implements ISysUsageService
{
    @Autowired
    private SysUsageMapper sysUsageMapper;



    /**
     * 查询领用管理
     *
     * @param usageId 领用管理主键
     * @return 领用管理
     */
    @Override
    public SysUsage selectSysUsageByUsageId(Long usageId)
    {
        return sysUsageMapper.selectSysUsageByUsageId(usageId);
    }

    /**
     * 查询领用管理列表
     *
     * @param sysUsage 领用管理
     * @return 领用管理
     */
    @Override
    public List<SysUsage> selectSysUsageList(SysUsage sysUsage)
    {
        return sysUsageMapper.selectSysUsageList(sysUsage);
    }

    /**
     * 新增领用管理
     *
     * @param sysUsage 领用管理
     * @return 结果
     */
    @Override
    public int insertSysUsage(SysUsage sysUsage)
    {
        sysUsage.setUsageDate(new Date());
        return sysUsageMapper.insertSysUsage(sysUsage);
    }

    /**
     * 修改领用管理
     *
     * @param sysUsage 领用管理
     * @return 结果
     */
    @Override
    public int updateSysUsage(SysUsage sysUsage)
    {
        return sysUsageMapper.updateSysUsage(sysUsage);
    }

    /**
     * 批量删除领用管理
     *
     * @param usageIds 需要删除的领用管理主键
     * @return 结果
     */
    @Override
    public int deleteSysUsageByUsageIds(Long[] usageIds)
    {
        return sysUsageMapper.deleteSysUsageByUsageIds(usageIds);
    }

    /**
     * 删除领用管理信息
     *
     * @param usageId 领用管理主键
     * @return 结果
     */
    @Override
    public int deleteSysUsageByUsageId(Long usageId)
    {
        return sysUsageMapper.deleteSysUsageByUsageId(usageId);
    }

    /**
     * 查询领用管理
     *
     * @param usagePeople
     * @return 领用管理
     */
    @Override
    public List<SysUsage> selectSysUsageByUsagePeople(String usagePeople) {
        return sysUsageMapper.selectSysUsageByUsagePeople(usagePeople);
    }
}
